{% extends "element/report/base.html" %}
{% load future wenlincms_tags wlcore_tags report_tags %}

{% block meta_title %}{{ el_post.ENTNAME }}{% endblock %}

{% block body %}
    <div id="report-box" class="report-tab">
        <div class="report-comtitle-box">
            <div class="report-comtitle">
                <span class="companytitle">{{ el_post.ENTNAME }}</span>
            </div>
        </div>

        <ul id="middlenav">
            <li><a href="javascript:void(0)" name="tab_complex" class="navactive">综合评价</a></li>
            <li><a href="javascript:void(0)" name="tab_gongshang">工商信息</a></li>
            <li><a href="javascript:void(0)" name="tab_related">关联幕后</a></li>
            <li><a href="javascript:void(0)" name="tab_fengxian">风险失信</a></li>
            {% if version == "10" %}
                <li><a href="javascript:void(0)" name="tab_caiwu">财务分析</a></li>
                <li><a href="javascript:void(0)" name="tab_jiaoyi">资产交易</a></li>
                <li><a href="javascript:void(0)" name="tab_news">事件舆情</a></li>
                <li><a href="javascript:void(0)" name="tab_zbzp">招标招聘</a></li>
            {% endif %}
        </ul>

        {% if not sitesettings.website_proxy %}
            <div id="printpdf">PDF</div>
        {% endif %}
        <div id="printbtn">打印</div>

        <img src="{{ STATIC_URL }}element/report/imgs/loading.gif" id="loadingimg"/>
        {#综合评价#}
        <div class="navbox" id="tab_complex">
            {% include "element/report/includes/company_report_credit.html" %}
        </div>
        {#工商#}
        <div class="navbox" id="tab_gongshang" data-doing="0"></div>
        {#关联幕后#}
        <div class="navbox" id="tab_related" data-doing="0"></div>
        {#风险失信#}
        <div class="navbox" id="tab_fengxian" data-doing="0"></div>
        {% if version == "10" %}
            <div class="navbox" id="tab_caiwu" data-doing="0"></div>
            {#资产交易#}
            <div class="navbox" id="tab_jiaoyi" data-doing="0"></div>
            {#事件舆情#}
            <div class="navbox" id="tab_news" data-doing="0"></div>
            {#招标招聘#}
            <div class="navbox" id="tab_zbzp" data-doing="0"></div>
        {% endif %}
    </div>
{% endblock %}

{% block extra_js %}
    <script src="{{ STATIC_URL }}{{ "element/report/js/report.js"|file_time_stamp }}"></script>
    <script src="{{ STATIC_URL }}{{ "element/report/js/report_charts.js"|file_time_stamp }}"></script>
    <script type="text/javascript">
        $(window).scroll(function () {
            var top = $(document).scrollTop();
            if (top > 140) {
                $("#middlenav").addClass("scrollnav");
            } else {
                $("#middlenav").removeClass("scrollnav");
            }
        });
        var alldata = {
            "total": [
                {% for obj in credit.total %}
                    {"{{ obj.year }}": {{ obj.value }}}{% if not forloop.last %},{% endif %}
                {% endfor %}
            ],
            {% for obj in credit.detail %}
                "{{ obj.year }}": {
                    "scores": {
                        "经营绩效": {{ obj.value.index_2_2|eldefault:"random" }},
                        "经营稳定": {{ obj.value.index_2_3|eldefault:"random" }},
                        "发展能力": {{ obj.value.index_2_4|eldefault:"random" }},
                        "资本实力": {{ obj.value.index_2_5|eldefault:"random" }},
                        "管理团队": {{ obj.value.index_2_1|eldefault:"random" }}
                    },
                    "performance": {
                        "盈利能力": {{ obj.value.index_3_4|eldefault:"random" }},
                        "经营成本": {{ obj.value.index_3_5|eldefault:"random" }},
                        "资金压力": {{ obj.value.index_3_6|eldefault:"random" }},
                        "资产周转能力": {{ obj.value.index_3_7|eldefault:"random" }},
                        "市场地位": {{ obj.value.index_3_8|eldefault:"random" }}
                    },
                    "stability": {
                        "负面记录": 80,
                        "权力稳定": {{ obj.value.index_3_10|eldefault:"random" }},
                        "集团稳定性": 75,
                        "经营波动": {{ obj.value.index_3_9|eldefault:"random" }}
                    },
                    "ability": {
                        "业务增长": 0,
                        "研发投入": 0,
                        "财务增长": {{ obj.value.index_3_11|eldefault:"random" }}
                    },
                    "relations": {
                        "关联企业评分": 0,
                        "股东关联": {{ 0|eldefault:"random" }},
                        "股东特质": {{ obj.value.index_3_12|eldefault:"random" }}
                    },
                    "team": {
                        "团队管理能力": {{ obj.value.index_3_3|eldefault:0 }},
                        "行业任职经验": {{ obj.value.index_3_2|eldefault:"random" }},
                        "团队教育背景": {{ obj.value.index_3_1|eldefault:"random" }}
                    },
                    "industryTrend": {
                        {% for nobj in obj.statistic_n %}
                            "{{ nobj.nic_name }}":{{ nobj.index_total }}{% if not forloop.last %},{% endif %}
                        {% endfor %}
                    },
                    "regionTrend": {
                        {% for robj in obj.statistic_r %}
                            "{{ robj.region_name }}":{{ robj.index_total }}{% if not forloop.last %},{% endif %}
                        {% endfor %}
                    }
                }{% if not forloop.last %},{% endif %}
            {% endfor %}
        };
        drawEcharts(alldata, {{ latest_year }});
    </script>
{% endblock %}
